package bignum;

import java.util.Arrays;
import java.util.List;

import static java.util.stream.Collectors.toList;

public class TestBooks {
    public static void main(String[] args) {
        List<Books> Bos = Arrays.asList(
                new Books("《白洋淀上》",110,"关仁山"),
                new Books("《三体》",99.9,"刘慈欣"),
                new Books("《水浒传》",120.9,"施耐庵"),
                new Books("《红楼梦》",180,"曹雪芹"),
                new Books("《西游记》",99,"吴承恩"),
                new Books("《红楼梦魇》",186,"张爱玲")
        );
        //
        List<String> BooksName=Bos.stream()
                .filter(d->d.getPrice()>100)  //过滤器 （过滤出卡路里小于400的数）
                .sorted((d1,d2)-> (int) (d1.getPrice()-d2.getPrice()))
                .map(d->d.getTitle()+" 价格："+d.getPrice())  // 映射，由元素对象
                .collect(toList());
        for(String name:BooksName)
            System.out.println(name);
    }
}
